OpenRoads Designer CONNECT Edition SDK Help

Get named boundaries from active model

The below code snippet shows how to get all named boundaries from active DGN model. The code iterates each name boundary and displays the name.


//Required References
using Bentley.DgnPlatformNET;
using Bentley.MstnPlatformNET;

public void BrowseAllNamedBoundaries()
        {
            //Get Active Dgn Model
            DgnModel model = Session.Instance.GetActiveDgnModel();

            //Get Named Boundary Collection using DgnModel
            NamedBoundaryCollection namedBoundaries = new NamedBoundaryCollection(model);

            //Iterate the Named Boundary Collection
            foreach (NamedBoundary namedBoundary in namedBoundaries)
            {
                //Show Named Boundaries names in Message Center
                MessageCenter.Instance.ShowInfoMessage(namedBoundary.UniqueName, namedBoundary.Name, false);
            }
        }